//
//  OCTOCViewController.m
//  GCD
//
//  Created by fangyuan ding on 2020/8/10.
//  Copyright © 2020 fangyuan ding. All rights reserved.
//

#import "OCTOCViewController.h"

@interface OCTOCViewController ()

@end

@implementation OCTOCViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSString *s1 = @"string";
    CFStringRef cfstring = (__bridge CFStringRef)s1;
    NSLog(@"%@",cfstring);
    
    
    
    CFStringRef s2 = CFStringCreateWithCString(NULL, "string", kCFStringEncodingASCII);
    NSString *fstring = (__bridge NSString*)s2;
     NSLog(@"%@",fstring);
    
    
    //Core Foundation转Foundation  _bridge _transfer  ARC管理对象的释放
    CFStringRef s3 = CFStringCreateWithCString(NULL, "string", kCFStringEncodingASCII);
    NSString *bfstring = (__bridge_transfer NSString*)s3;
    NSLog(@"%@",bfstring);
    
    //Foundation转Core Foundation  _bridge _retained  MRC管理对象的释放
    NSString *s4 = @"string";
    CFStringRef cfrstring = (__bridge_retained CFStringRef)s4;
    NSLog(@"%@",cfrstring);
    
    
    
}



@end
